home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
New Star Software Collection
/
NSS_Collection.iso
/
3-004 ms visual basic pro 30
/
4.imz
/
4.IMA
/
CD.FR_
/
CD.bin
Wrap
Text File
|
1993-04-28
|
9KB
|
299 lines
VERSION 2.00
Begin Form CD
BorderStyle = 1 'Fixed Single
ClientHeight = 3120
ClientLeft = 675
ClientTop = 1800
ClientWidth = 8415
Height = 3525
Left = 615
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3120
ScaleWidth = 8415
Top = 1455
Width = 8535
Begin PictureBox Picture4
BackColor = &H00808080&
Height = 3255
Left = 0
ScaleHeight = 3225
ScaleWidth = 1545
TabIndex = 12
Top = -15
Width = 1570
Begin PictureBox Picture5
BackColor = &H00575757&
Height = 2895
Left = 120
ScaleHeight = 2865
ScaleWidth = 1275
TabIndex = 13
Top = 110
Width = 1300
End
End
Begin PictureBox Picture6
BackColor = &H00808080&
Height = 3255
Left = 6845
ScaleHeight = 3225
ScaleWidth = 1545
TabIndex = 14
Top = -15
Width = 1575
Begin PictureBox Picture7
BackColor = &H00575757&
Height = 2895
Left = 120
ScaleHeight = 2865
ScaleWidth = 1275
TabIndex = 15
Top = 110
Width = 1300
End
End
Begin Frame Frame1
BackColor = &H00808080&
Caption = "MCI CD Player"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 3135
Left = 1560
TabIndex = 0
Top = 0
Width = 5295
Begin PictureBox Picture3
Height = 255
Left = 720
Picture = CD.FRX:0000
ScaleHeight = 225
ScaleWidth = 945
TabIndex = 10
Top = 2520
Visible = 0 'False
Width = 975
End
Begin Frame Frame4
BackColor = &H00808080&
Height = 975
Left = 2160
TabIndex = 6
Top = 2040
Width = 2895
Begin CommandButton Command1
Caption = "Load"
Height = 255
Left = 1920
TabIndex = 7
Top = 600
Width = 855
End
Begin PictureBox Picture1
BackColor = &H00404040&
BorderStyle = 0 'None
Height = 255
Left = 120
Picture = CD.FRX:09D2
ScaleHeight = 255
ScaleWidth = 2655
TabIndex = 8
Top = 240
Width = 2655
End
Begin Label Label3
BackColor = &H00404040&
Height = 135
Left = 1485
TabIndex = 11
Top = 600
Width = 255
End
End
Begin PictureBox Picture2
Height = 255
Left = 720
Picture = CD.FRX:1068
ScaleHeight = 225
ScaleWidth = 945
TabIndex = 9
Top = 2040
Visible = 0 'False
Width = 975
End
Begin Frame Frame2
BackColor = &H00808080&
Height = 1455
Left = 240
TabIndex = 1
Top = 480
Width = 4815
Begin MMControl MMControl1
BackVisible = 0 'False
Height = 615
Left = 2160
RecordVisible = 0 'False
StepVisible = 0 'False
TabIndex = 2
Top = 360
Width = 2370
End
Begin Frame Frame3
BackColor = &H00808080&
Height = 855
Left = 720
TabIndex = 3
Top = 240
Width = 855
Begin Label Label4
BackColor = &H00808080&
Caption = " Track "
Height = 255
Left = 120
TabIndex = 5
Top = 480
Width = 615
End
Begin Label Label1
Alignment = 2 'Center
Caption = "0"
Height = 255
Left = 240
TabIndex = 4
Top = 240
Width = 375
End
End
End
End
End
Sub Command1_Click ()
' Open the CD device -- the disk must already be
' in the drive.
On Error GoTo MCI_ERROR
MMControl1.Command = "Open"
On Error GoTo 0
' Set the time format
MMControl1.TimeFormat = MCI_FORMAT_TMSF
' Disable the Load command button, display the
' "disk in drive" bitmap.
Command1.Enabled = False
Picture1.Picture = Picture3.Picture
' Set the track number to the first track.
Label1.Caption = "1"
Exit Sub
MCI_ERROR:
DisplayErrorMessageBox
Resume MCI_EXIT
MCI_EXIT:
Unload CD
End Sub
Sub Form_Load ()
' Force the MCI control to complete before returning
' to the application.
MMControl1.Wait = True
MMControl1.UpdateInterval = 0
' Set the DeviceType to a musical CD device.
MMControl1.DeviceType = "CDAudio"
' Set the track number to 0 (default).
Label1.Caption = "0"
End Sub
Sub Form_Unload (Cancel As Integer)
MCITest.Show
End Sub
Sub MMControl1_EjectClick (Cancel As Integer)
' Enable the Load command button, and display the
' "disk out of drive" bitmap.
Command1.Enabled = True
Picture1.Picture = Picture2.Picture
MMControl1.UpdateInterval = 0
' Eject the disk from the CD drive, and close the device.
On Error GoTo MCI_ERROR2
MMControl1.Command = "Eject"
MMControl1.Command = "Close"
On Error GoTo 0
' Set the track number back to 0.
Label1.Caption = "0"
' Set the "play indicator" to off.
Label3.BackColor = &H404040
Exit Sub
MCI_ERROR2:
DisplayErrorMessageBox
Resume Next
End Sub
Sub MMControl1_NextCompleted (ErrorCode As Long)
' Set the track number to the new track.
Label1.Caption = Str$(MMControl1.Track)
End Sub
Sub MMControl1_PauseClick (Cancel As Integer)
MMControl1.UpdateInterval = 0
'Set the "play indicator" to off.
Label3.BackColor = &H404040
End Sub
Sub MMControl1_PlayClick (Cancel As Integer)
MMControl1.UpdateInterval = 1000
' Set the track number to the current track.
Label1.Caption = Str$(MMControl1.Track)
End Sub
Sub MMControl1_PrevCompleted (ErrorCode As Long)
' Set the track number to new track.
Label1.Caption = Str$(MMControl1.Track)
End Sub
Sub MMControl1_StatusUpdate ()
' Set the track number to the current track.
Label1.Caption = Str$(MMControl1.Position And &HFF)
' Determine if the "play indicator" is off or on,
' based if the device is currently playing.
If MMControl1.Mode = MCI_MODE_PLAY Then
Label3.BackColor = &H80FF&
Else
Label3.BackColor = &H404040
End If
End Sub
Sub MMControl1_StopClick (Cancel As Integer)
MMControl1.UpdateInterval = 0
' Set the "play indicator" to off.
Label3.BackColor = &H404040
' Reset the CD to track 1.
MMControl1.To = MMControl1.Start
MMControl1.Command = "Seek"
MMControl1.Track = 1
Label1.Caption = "1"
End Sub